package asn.match.model;

// Generated 15 juin 2014 03:03:18 by Hibernate Tools 4.0.0

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * FriendRelation generated by hbm2java
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "friend_relation", catalog = "muslima_sphere", uniqueConstraints = @UniqueConstraint(columnNames = {
		"source_member_id", "target_member_id" }))
public class FriendRelation implements java.io.Serializable {

	private Integer idFriendRelation;
	private MemberAccount memberAccountBySourceMemberId;
	private MemberAccount memberAccountByTargetMemberId;
	private String friendGroup;
	private String requestStatus;
	private Date createdAt;
	private Date modifiedAt;

	public FriendRelation() {
	}

	public FriendRelation(MemberAccount memberAccountBySourceMemberId,
			MemberAccount memberAccountByTargetMemberId, String friendGroup,
			String requestStatus, Date createdAt, Date modifiedAt) {
		this.memberAccountBySourceMemberId = memberAccountBySourceMemberId;
		this.memberAccountByTargetMemberId = memberAccountByTargetMemberId;
		this.friendGroup = friendGroup;
		this.requestStatus = requestStatus;
		this.createdAt = createdAt;
		this.modifiedAt = modifiedAt;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_friend_relation", unique = true, nullable = false)
	public Integer getIdFriendRelation() {
		return this.idFriendRelation;
	}

	public void setIdFriendRelation(Integer idFriendRelation) {
		this.idFriendRelation = idFriendRelation;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "source_member_id", nullable = false)
	public MemberAccount getMemberAccountBySourceMemberId() {
		return this.memberAccountBySourceMemberId;
	}

	public void setMemberAccountBySourceMemberId(
			MemberAccount memberAccountBySourceMemberId) {
		this.memberAccountBySourceMemberId = memberAccountBySourceMemberId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "target_member_id", nullable = false)
	public MemberAccount getMemberAccountByTargetMemberId() {
		return this.memberAccountByTargetMemberId;
	}

	public void setMemberAccountByTargetMemberId(
			MemberAccount memberAccountByTargetMemberId) {
		this.memberAccountByTargetMemberId = memberAccountByTargetMemberId;
	}

	@Column(name = "friend_group", nullable = false, length = 14)
	public String getFriendGroup() {
		return this.friendGroup;
	}

	public void setFriendGroup(String friendGroup) {
		this.friendGroup = friendGroup;
	}

	@Column(name = "request_status", nullable = false, length = 8)
	public String getRequestStatus() {
		return this.requestStatus;
	}

	public void setRequestStatus(String requestStatus) {
		this.requestStatus = requestStatus;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_at", nullable = false, length = 19)
	public Date getCreatedAt() {
		return this.createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "modified_at", nullable = false, length = 19)
	public Date getModifiedAt() {
		return this.modifiedAt;
	}

	public void setModifiedAt(Date modifiedAt) {
		this.modifiedAt = modifiedAt;
	}

}
